TEC-56: live-data docking for product-app entry surfaces#21
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR switches the product-facing app to use platform API contracts by default for auth session bootstrap, marketplace preview, provider discovery, and provider profile loading. It replaces several demo/default behaviors with platform-driven flows, adds data-loading and error states for provider profiles, and tightens marketplace preview validation and health signaling. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ProviderProfileRoute
participant useEffect
participant loadProviderDetail
participant PlatformAPI
participant ProviderProfile
User->>ProviderProfileRoute: Navigate to provider profile
ProviderProfileRoute->>ProviderProfileRoute: Extract providerUserId from URL params
ProviderProfileRoute->>useEffect: Trigger on mount/param change
useEffect->>loadProviderDetail: Call loadProviderDetail(providerUserId)
ProviderProfileRoute->>ProviderProfile: Render loading spinner
loadProviderDetail->>PlatformAPI: Fetch using platformApiBaseUrl + path
alt Success
PlatformAPI-->>loadProviderDetail: Return provider data
loadProviderDetail->>ProviderProfileRoute: Return normalized provider
ProviderProfileRoute->>ProviderProfile: Render with provider data + callbacks
ProviderProfile->>User: Display profile
else Missing/Invalid ID or Fetch Error
loadProviderDetail->>ProviderProfileRoute: Return error state / notFound
ProviderProfileRoute->>ProviderProfile: Render error view with "Back to discovery"
ProviderProfile->>User: Display error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/product-app/src/features/marketplace/marketplace-preview-data.ts (1)
161-178: Avoid hard-codedstatusDigestin the empty-state branch.Line 168 hard-codes a digest format already centralized in
buildPreviewStatusDigest; this can drift if the digest schema changes.♻️ Proposed refactor
if (sections.length === 0) { + const severityBadgeToken = 'badge-critical' as const; + const coverageBandToken = 'coverage-low' as const; + const alignmentToken = 'align-risk' as const; return { level: 'critical', summary: 'Marketplace preview payload is empty.', narrative: 'No valid preview sections were returned by platform-api.', riskHeadline: 'Critical risk: preview cannot render customer entry sections from live data.', - severityBadgeToken: 'badge-critical', - statusDigest: 'critical|badge-critical|coverage-low|align-risk|g0-w0-c0|cw0-cp0-cm0', - coverageBandToken: 'coverage-low', - alignmentToken: 'align-risk', + severityBadgeToken, + statusDigest: buildPreviewStatusDigest({ + level: 'critical', + severityBadgeToken, + coverageBandToken, + alignmentToken, + goodSections: 0, + watchSections: 0, + criticalSections: 0, + coverageWellSections: 0, + coveragePartialSections: 0, + coverageMinimalSections: 0, + }), + coverageBandToken, + alignmentToken, criticalSections: 0, watchSections: 0, goodSections: 0,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts` around lines 161 - 178, The empty-state branch currently returns a hard-coded statusDigest string; replace that hard-coded value by calling the centralized buildPreviewStatusDigest(...) function so the digest stays consistent with the rest of the module. In the return object for the sections.length === 0 case, keep the existing tokens (severityBadgeToken, coverageBandToken, alignmentToken, and other flags/counts) but compute statusDigest by invoking buildPreviewStatusDigest with the same tokens/flags used elsewhere (e.g., severityBadgeToken, coverageBandToken, alignmentToken, critical/watch/good counts or coverage flags) instead of the literal 'critical|badge-critical|...'.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts`:
- Around line 446-453: The code must guard against non-array payload.sections
before mapping; change the logic that computes sections to use
Array.isArray(payload.sections) — if true, map payload.sections to the existing
section shape, otherwise set sections = [] — so the subsequent check (if
(sections.length === 0) { return { sections: [], previewHealth:
derivePreviewHealth([]), source: 'platform-api', errorMessage: ... } }) will run
instead of throwing; update any code paths that assume payload.sections is an
array (referencing payload.sections, sections, and derivePreviewHealth) and add
unit tests that send malformed payload.sections values (object, string, number,
null) to verify the degraded 'platform-api' response is returned rather than
throwing.
---
Nitpick comments:
In `@apps/product-app/src/features/marketplace/marketplace-preview-data.ts`:
- Around line 161-178: The empty-state branch currently returns a hard-coded
statusDigest string; replace that hard-coded value by calling the centralized
buildPreviewStatusDigest(...) function so the digest stays consistent with the
rest of the module. In the return object for the sections.length === 0 case,
keep the existing tokens (severityBadgeToken, coverageBandToken, alignmentToken,
and other flags/counts) but compute statusDigest by invoking
buildPreviewStatusDigest with the same tokens/flags used elsewhere (e.g.,
severityBadgeToken, coverageBandToken, alignmentToken, critical/watch/good
counts or coverage flags) instead of the literal 'critical|badge-critical|...'.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f501b7b-d4e7-4e3b-a94c-05e18b5619cb
📒 Files selected for processing (10)
README.mdapps/product-app/app/provider-profile.jsapps/product-app/src/features/auth/auth-action-panel.jsapps/product-app/src/features/auth/auth-entry-section.jsapps/product-app/src/features/discovery/provider-detail-actions.tsapps/product-app/src/features/marketplace/marketplace-preview-data.test.tsapps/product-app/src/features/marketplace/marketplace-preview-data.tsapps/product-app/src/features/marketplace/marketplace-preview-screen.jsapps/product-app/src/features/marketplace/provider-profile-screen.jsapps/product-app/src/shared/session-bootstrap.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 2 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
/provider-profileto live provider detail API flow with explicit loading/error statesValidation
Summary by CodeRabbit
New Features
Bug Fixes / UX
Documentation